โœจ ์œ ์ € ์ธ์ฆ - ์˜ค๋ฒ„๋“œ๋ผ์ด๋ธŒ API

๐ŸŽฎ Request

const requestOptions = {
  method: "GET",
  redirect: "follow"
};

fetch("https://www.library.kr/cyber/api/overdrive/auth?LibraryCard=albatro3&PIN=abc1234!", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));

๐Ÿ“œ Response

์„ฑ๊ณต์‹œ

<AuthorizeResponse>
  <ErrorDetails>The user information could not be found.</ErrorDetails>
  <Status>0</Status>
</AuthorizeResponse>
Status code ๋น„๊ณ 
1 ์„ฑ๊ณต(์ผ์น˜)
0 ์‹คํŒจ

์‹คํŒจ์‚ฌ์œ ๋Š” ErrorDetails ๋กœ ๋ฐ˜ํ™˜

์‹คํŒจ์‹œ

{
  "httpStatus": "METHOD_NOT_ALLOWED",
  "errorCode": null,
  "errorResult": null,
  "message": "Method Not Allowed",
  "errors": null
}
{
    "httpStatus": "INTERNAL_SERVER_ERROR",
    "errorCode": null,
    "errorResult": null,
    "message": "Server Error",
    "errors": null
}